package day03;
//switch...case
public class SwitchCaseDemo {
    public static void main(String[] args) {
        int num = 2;//if(num==1)
        switch(num){//可选整型：byte，short,int,char；String,枚举也行
            default://所有case都未匹配时执行
                System.out.println(666);//666
            case 1:
                System.out.println(111);
            case 2://以此为入口，贯穿后续，继续执行
                System.out.println(222);//222
            case 3:
                System.out.println(333);//333


        int age = 3;
        switch(age){
            case 1:
                System.out.println("一周岁");
                break;
            case 2:
                System.out.println("二周岁");
                break;
            case 3://以此为入口
                System.out.println("三周岁");//三周岁
                break;//打断执行
            default :
                System.out.println("超出年龄");
        }
        }
    }
}
